hysop.operator.base.stretching_dir module

class hysop.operator.base.stretching_dir.DirectionalStretchingBase(formulation, velocity, vorticity, variables, dt, C=None, A=None, implementation=None, base_kwds=None, **kwds)[source]

Bases: object

Initialize directional stretching operator python backend.

Solves dW/dt = C * f(U,W) where U is the velocity, W the vorticity and f is one of the following formulation:

CONSERVATIVE FORMULATION: f(U,W) = div( U : W ) MIXED GRADIENT FORMULATION: f(U,W) = (A*grad(U) + (1-A)*grad(U)^T) . W

whererepresents the outer product U:W = (Ui*Wj)ij.

. represents the matrix-vector product.

^T is the transposition operator

U and W are always three dimensional fields. C is scalar or 3d vector-like of symbolic coefficients. A is a scalar symbolic coefficient. f(U,W) is always directionally splittable.

Parameters:
  • formulation (hysop.constants.StretchingFormulation) –

    The formulation of this stretching operator: CONSERVATIVE: f(U,W) = div( U : W ) GRAD_UW: f(U,W) = grad(U) . W GRAD_UW_T: f(U,W) = grad(U)^T . W MIXED_GRAD_UW: f(U,W) = (A*grad(U) + (1-A)*grad(U)^T) . W

    where A is a user given scalar or 3d vector like that contains scalar (floating point) coefficient(s) or parameter(s). The most common mixed gradient formulation is A=0.5.

    Only CONSERVATIVE formulation is implemented yet in python.

  • velocity (Field) – Velocity U as read-only input three-dimensional continuous field.

  • vorticity (Field) – Vorticity W as read-write three-dimensional continuous field.

  • variables (dict) – Dictionary of fields as keys and topology descriptors as values.

  • dt (ScalarParameter) – Timestep parameter that will be used for time integration.

  • C (scalar or vector like of 3 symbolic coefficients, optional) – The stretching leading coefficient C can be scalar or vector like. Contained values should be numerical coefficients, parameters or generic symbolic expressions such that C*f(U,W) is directionally splittable. Here * is the classical elementwise multiplication. Default value is 1.

  • A (scalar symbolic coefficient, optional) – Should only be given for MIXED_GRAD_UW formulations. ValueError will be raised on other formulations. The linear combination coefficients A is a scalar. Contained value should be a numerical coefficient, a parameter (or a generic symbolic expression) such that C*(A*grad(U).W + (1-A)*grad^T(U).W) is directionally splittable. Here * is the classical elementwise multiplication. Default value is 0.5.

  • name (str, optional, defaults to 'stretching'.) – Name of this stretching operator.

  • implementation (Implementation, optional, defaults to None) – Target implementation, should be contained in available_implementations(). If None, implementation will be set to default_implementation().

  • base_kwds (dict, optional, defaults to None) – Base class keywords arguments. If None, an empty dict will be passed.

  • kwds – Keywords arguments that will be passed towards implementation operator __init__.

classmethod available_methods()[source]
classmethod default_method()[source]
discretize()[source]
get_field_requirements()[source]
get_work_properties()[source]
handle_method(method)[source]
classmethod supported_dimensions()[source]